package com.example.jobback.config;


import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.core.env.Environment;
import org.springframework.boot.context.config.Profiles;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;


/**
 * @ClassName: SwaggerConfig
 * @Description: swagger接口文档配置类
 * @Author: lhb
 * @Date: 2025/5/12
 */

@Configuration
@EnableKnife4j
public class SwaggerConfig {
    /**
     * @Description: 配置swagger基本信息
     * @return OpenAPI
     * @Author lhb
     * @CreateTime 2025/6/21 14:15
     */
//    @Bean
//    public OpenAPI swaggerOpenApi() {
//        return new OpenAPI()
//                .info(new Info().title("Swagger聘途")
//                        .description("Swagger接口文档")
//                        .version("v1.0"));
//    }

    @Bean
    public OpenAPI swaggerOpenApi() {
        return new OpenAPI()
                .info(new Info()
                        .title("聘途系统API文档")
                        .description("包含用户端，企业端和管理端业务接口")
                        .version("v1.0")
                        .contact(new Contact()  // 作者信息（不含网址）
                                .name("聘途四人组")
                                .email("2226338422@qq.com"))  // 移除了.url()配置
                        .license(new License()  // 协议信息
                                .name("Apache 2.0")
                                .url("https://www.apache.org/licenses/LICENSE-2.0.html")))
                // 不添加外部文档链接
                .externalDocs(null);
    }
}
